package cn.ranko.shiro.controller;

import cn.ranko.bean.Datagrid;
import cn.ranko.bean.Pagination;
import cn.ranko.shiro.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by user on 2017/8/30.
 */
@Controller
@RequestMapping("/shiro/portlet")
public class PortletController {

    @Autowired
    SysUserService sysUserService;

    @RequestMapping("/userlist.action")
    @ResponseBody
    public Datagrid userlist(Integer page, Integer rows){
        Pagination pagination = new Pagination();
        pagination.setPage(page);
        pagination.setRows(rows);
        return sysUserService.loadList(pagination);
    }

}
